/*工具模块*/
export let name = 'tom'
export let age = 18
export let gender = '男'

//日期格式化的方法
export function formatDate(times) {
  let date = times ? new Date(times) : new Date()
  let year = date.getFullYear()
  let month = (date.getMonth() + 1 + '').padStart(2, '0')
  let day = (date.getDate() + '').padStart(2, '0')
  let hour = (date.getHours() + '').padStart(2, '0')
  let min = (date.getMinutes() + '').padStart(2, '0')
  let second = (date.getSeconds() + '').padStart(2, '0')
  return `${year}-${month}-${day} ${hour}:${min}:${second}`
}